Release 10.1A: OpenEdge Development:
Progress Dynamics Web Development Guide
Extending existing JavaScript object types
You can customize the Progress Dynamics DHTML framework by extending objects with your own JavaScript code. You can do this by configuring existing objects to use alternative code for object instantiation. To do this, you must know JavaScript fairly well and must be able to read the current code.
You might also have future compatibility issues if the APIs change. Generally, extending existing objects is safer than replacing them. Also, since ADM objects expect a certain API, the best method for extending JavaScript object types is to make modifications based on an existing object type.
For example, consider the
Browseobject that is defined inrybrowse.js.
![]()
To extend the
Browseobject:
- Create a new file (for example,
mybrowse.js) in the install_dir/tty/dynamics/dhtml/directory. The defaultrybrowse.jsis also found in install_dir/tty/dynamics/dhtml/.- Include your file by adding a
SCRIPTelement to your default HTML file. For example:
- Define an object prototype that is similar to the object defined in
rybrowse.js.The object prototype name must have the first letter uppercase and the rest in lowercase. See
Browse2in the following example:
- Specify your object prototype name as a
JavaScriptObjectattribute for the application object.The
JavaScriptObjectattribute is one of the attributes that you can set in the Dynamic Properties dialog box. For example, the following figure shows a setting that causesBrowseto be overridden byBrowse2in thecustomerfullbapplication object:
![]()
When the application handler object initiates
customerfullb, it will see theBrowse2object type and initiate it with theBrowse2prototype.
|
Copyright © 2005 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |